import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import App from './App'

// 导入 Antd UI 依赖
import { ConfigProvider } from 'antd'
import zhCN from 'antd/locale/zh_CN'
import { dark } from '@/theme'

// 导入 Redux 依赖
import { Provider } from 'react-redux'
import { PersistGate } from 'redux-persist/integration/react'
import { persistor, store } from '@/redux/index'

// 导入 React Router 依赖
import { RouterProvider } from 'react-router-dom'
import router from '@/router/index'

import '@/styles/index.scss'

createRoot(document.getElementById('root')!).render(
  <ConfigProvider locale={zhCN} theme={dark}>
    <Provider store={store}>
      <PersistGate loading={null} persistor={persistor}>
        <StrictMode>
          <RouterProvider router={router}></RouterProvider>
        </StrictMode>
      </PersistGate>
    </Provider>
  </ConfigProvider>
)
